'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  const jwt = app.middleware.jwt;

  router.post('/register', controller.home.register);
  router.post('/login', controller.home.login);
  router.post('/cs', jwt(), controller.home.cs);
  // {roles: [-1]}
  
  router.post('/userList', jwt(), controller.user.userList);
  router.post('/userDelete', jwt(), controller.user.userDelete);
  router.post('/userPost', jwt(), controller.user.userPost);


  router.post('/vipPost', jwt(), controller.vip.vipPost);
  router.post('/vipGet', jwt(), controller.vip.vipGet);
  router.post('/vipTapUp', jwt(), controller.vip.vipTapUp);

  router.post('/addConsume', jwt(), controller.consume.addConsume);
  router.post('/getConsume', jwt(), controller.consume.getConsume);
  router.post('/uptConsume', jwt(), controller.consume.upConsume);
  router.post('/delConsume', jwt(), controller.consume.delConsume);

  router.post('/addConsumerOrders', jwt(), controller.consumerOrders.addConsumerOrders);
};
